<?php
header("Content-Type:text/html;charset=gb2312");

class AjaxloginController extends Zend_Controller_Action
{

	private function getDb(){
		$dbAdapter = Zend_Controller_Front::getInstance()->getParam('bootstrap')
		->getPluginResource('db')
		->getDbAdapter();

		return $dbAdapter;




	}
	public function init()
	{
		/* Initialize action controller here */

	}

	public function indexAction()
	{
		// action body
$this->_helper->layout->disableLayout();
		
$username=$_GET["username"];

//
//echo 1;
		$db=$this->getDb();
		$select=$db->select();
		$sql=$select->from('user','username')
		->where('username=?',$username);
		$result=$db->fetchOne($sql);
//		
		if ($username==$result){
		echo 0;} else {echo 1;}
//
//
	}



}

